﻿using System;
using Portal.API;

namespace Portal
{
	/// <summary>
	/// Holds the PortalTab and Header Control in the 'Table' Mode
	/// </summary>
	public partial class DisplayContent : System.Web.UI.Page
	{
	    protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsClientScriptBlockRegistered("MPosition") && Page.User.IsInRole(Config.AdminRoles))
            {
                Page.RegisterClientScriptBlock("MPosition", "<script src=\"/scripts/MPosition.js\"></script>");
            }
            metades.Attributes.Add("content","");
            //doc va xay dung css cho trang
            string[] strTabRef = null;
            if (Request.QueryString["TabRef"] != null)
            {
                if (Request.QueryString["RealRef"] != null)
                {
                    strTabRef = Request.QueryString["RealRef"].ToString().Split(".".ToCharArray());
                }
                else
                    strTabRef = Request.QueryString["TabRef"].ToString().Split(".".ToCharArray());
                string strStylePaht = strTabRef[strTabRef.Length - 1];
                if (strTabRef.Length >= 3)
                    strStylePaht = strTabRef[1];
                ltrCssMngr.Text += "<link href=\"/styles/front_end/" + strStylePaht +
                                   "/TopNews.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
                ltrCssMngr.Text += "<link href=\"/styles/front_end/" + strStylePaht +
                                   "/Header.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
                ltrCssMngr.Text += "<link href=\"/styles/front_end/" + strStylePaht +
                                   "/ListNews.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
                ltrCssMngr.Text += "<link href=\"/styles/front_end/" + strStylePaht +
                                   "/footer.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
                ltrCssMngr.Text += "<link href=\"/styles/front_end/" + strStylePaht +
                                   "/Content.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
                clock.Attributes.Add("class", strStylePaht + "_clock");

                metades.Attributes.Add("content", Portal.BO.UnicodeUtility.keywords);
                //metaTitle.InnerText +=" - "+ Portal.BO.UnicodeUtility.keywords;
            }
            //đưa thông tin logs
            PortalDefinition.Tab _objCurrentTab = PortalDefinition.GetCurrentTab();
        }

	    override protected void OnInit(EventArgs e)
		{
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			InitializeComponent();
			base.OnInit(e);
			
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    

		}
	}
}
